<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>博客后台管理 - 更新友链</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../static/css/font.css">
    <link rel="stylesheet" href="../../static/css/weadmin.css">
</head>

<body>
    <div class="weadmin-body">
        <form class="layui-form" style="width: 700px;" lay-filter="updateLink">
            <div class="layui-form-item">
                <label class="layui-form-label">名称</label>
                <div class="layui-input-block">
                    <input type="text" name="linkName" required lay-verify="required" placeholder="请输入标题"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">网址</label>
                <div class="layui-input-block">
                    <input type="text" name="linkSite" required lay-verify="required" placeholder="请输入标题"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">头像</label>
                <div class="layui-input-block">
                    <input type="text" name="linkAvatar" required lay-verify="required" placeholder="请输入标题"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">描述</label>
                <div class="layui-input-block">
                    <textarea name="linkDescription" lay-verify="required" placeholder="请输入内容" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="linkId">
                    <button class="layui-btn" lay-submit lay-filter="update">更新</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>

        <script src="../../lib/layui/layui.js" charset="utf-8"></script>
        <script src="update-link.js" type="text/javascript"></script>
        <script>
            function setdata(data) {
                //渲染表单
                layui.use(['form', 'jquery'], function () {
                    var form = layui.form,
                        $ = layui.jquery;

                    form.val('updateLink', {
                        "linkId": data['id'],
                        "linkName": data['linkName'],
                        "linkSite": data['linkSite'],
                        "linkAvatar": data['linkAvatar'],
                        "linkDescription": data['linkDescription']
                    });
                });
            }
        </script>
    </div>
</body>
</html>